package com.guochenglang.www.dao.impl;

import com.guochenglang.www.pojo.Reply;
import com.guochenglang.www.util.GetTable;
import com.guochenglang.www.util.connect.JdbcUtil;

import java.sql.SQLException;
import java.util.ArrayList;

/**
 * 回复表的Dao层
 *
 * @author GuoChenglang
 */
public class ReplyDaoImpl implements com.guochenglang.www.dao.ReplyDao {
    /**
     * 表名
     */
    private static final String TABLE = GetTable.getTable(Reply.class);

    @Override
    public ArrayList<Reply> replySelect(Reply reply) throws SQLException, InterruptedException, IllegalAccessException, InstantiationException {
        return JdbcUtil.selectMax(TABLE, reply);
    }

    @Override
    public int insertReply(Reply reply) throws SQLException, InterruptedException, IllegalAccessException {
        return JdbcUtil.insert(TABLE, reply);
    }

    @Override
    public int deleteReply(Reply reply) throws SQLException, InterruptedException, IllegalAccessException {
        return JdbcUtil.delete(TABLE, reply);
    }
}
